package com.stock.common.utils;

import javax.servlet.http.HttpServletResponse;

/**
 * @author HuangChuQin
 * @ClassName: CommonUtils
 * @Description: TODO
 * @date 2020/6/30 1:36
 */
public class CommonUtils {
    public static String printDataJason(HttpServletResponse response, Object item) {
        try {
            JsonUtils.renderString(response, item);
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }

    public static String createRandomVcode(int len) {
        String vcode = "";
        for (int i = 0; i < len; i++) {
            vcode = vcode + (int) (Math.random() * 9);
        }
        return vcode;
    }
}
